package org.jeecg.entity.car;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.enums.car.CarEntryTypeEnum;
import org.jeecg.enums.car.CarPlateColorEnum;
import org.jeecg.enums.car.CarReleaseTypeEnum;
import org.jeecg.modules.system.entity.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;

/**
 * @Description: 车场进出记录
 * @Author: liurui
 * @Date:   2020-09-27
 * @Version: V1.0
 */
@Data
@TableName("car_parking_record")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="car_parking_record对象", description="车场进出记录")
public class CarParkingRecord  extends BaseEntity {
    
	/**id*/
	@TableId(type = IdType.ID_WORKER_STR)
    @ApiModelProperty(value = "id")
	private String id;

	private String tenantId;

	private String projectId;

	private String parkId;

	/**外部车场ID*/
	@ApiModelProperty(value = "外部车场ID")
	private String outParkId;
	/**进场时间*/
	@Excel(name = "进场时间", width = 15)
    @ApiModelProperty(value = "进场时间")
	private String parkName;
	/**记录id*/
    @ApiModelProperty(value = "记录id")
	@Excel(name = "记录号", width = 15)
	private String recordId;

	private String carId;

	/**车牌号*/
	@Excel(name = "车牌号", width = 15)
    @ApiModelProperty(value = "车牌号")
	private String carNo;
	/**入场时间*/
	@Excel(name = "入场时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "入场时间")
	private Date entranceTime;
	/**出场时间*/
	@Excel(name = "出场时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "出场时间")
	private Date exitTime;
	/**进场通道*/
    @ApiModelProperty(value = "进场通道")
	private String entrancegateId;
    @TableField(exist = false)
    private String entranceGateName;
	/**出场通道*/
    @ApiModelProperty(value = "出场通道")
	private String exitgateId;
	@TableField(exist = false)
	private String exitGateName;
	/**放行类型 0 正常放行 1 收费放行 2 免费放行 3 异常放行*/
    @ApiModelProperty(value = "放行类型 0 正常放行 1 收费放行 2 免费放行 3 异常放行")
	private Integer releaseType;

    @TableField(exist = false)
	@Excel(name = "放行类型", width = 15)
	private String releaseTypeName;

	/**车类描述id*/
    @ApiModelProperty(value = "车类描述id")
	private String carType;

	//@Excel(name = "车类描述", width = 15)
	@TableField(exist = false)
	private String carTypeName;

	/**车型描述id*/
    @ApiModelProperty(value = "车型描述id")
	private String carModel;

	//@Excel(name = "车型描述", width = 15)
	@TableField(exist = false)
	private String carModelName;

	/**入场类型(0正常，1过期转临停,2车位占用转临停)*/
    @ApiModelProperty(value = "入场类型(0正常，1过期转临停,2车位占用转临停)")
	private Integer enterType;

    @TableField(exist = false)
	@Excel(name = "入场类型", width = 15)
	private String enterTypeName;

	/**车牌类型 0 蓝牌 1 黑牌 2 黄牌 3 新黄牌 4 黄 色后牌 5 警车 6 军车 7 新黄色后 8武警 9新白牌 */
	@ApiModelProperty(value = "车牌类型 0 蓝牌 1 黑牌 2 黄牌 3 新黄牌 4 黄 色后牌 5 警车 6 军车 7 新黄色后 8武警 9新白牌 ")
	private Integer plateColor;

	@TableField(exist = false)
	@Excel(name = "车牌类型", width = 15)
	private String plateColorName;

	@ApiModelProperty(value = "入场上传状态0:未上传 1:已上传")
	private Boolean arrivedStatus;

	@ApiModelProperty(value = "离场上传状态0:未上传 1:已上传")
	private Boolean leaveStatus;

	@ApiModelProperty(value = "应付金额")
	private Integer payMoney;

//	/**进场图片*/
//    @ApiModelProperty(value = "进场图片")
//	private Object inimgPicture;
//
//	/**出场图片*/
//    @ApiModelProperty(value = "出场图片")
//	private Object outimgPicture;

	/**是否出场 0出场 1入场*/
    @ApiModelProperty(value = "是否出场 0出场 1入场")
	@Excel(name = "是否出场", width = 15, replace = {"出场_0","入场_1"})
	private Integer isExit;

	/**记录创建时间*/
	@Excel(name = "记录创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "记录创建时间")
	private Date createTime;
	/**记录修改时间*/
	@Excel(name = "记录修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "记录修改时间")
	private Date updateTime;
	/**createBy*/
    @ApiModelProperty(value = "createBy")
	private String createBy;
	/**updateBy*/
    @ApiModelProperty(value = "updateBy")
	private String updateBy;
	/**delFlag*/
    @ApiModelProperty(value = "delFlag")
	private String delFlag;
	/**remarks*/
	@Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "remarks")
	private String remarks;

	/*搜索条件 时间类型 0：入场时间 1出场时间*/
	@TableField(exist = false)
	private Integer timeType;
	//搜索条件 开始时间
	@TableField(exist = false)
	private String startTime;
	//搜索条件 结束时间
	@TableField(exist = false)
	private String endTime;

	@TableField(exist = false)
	private String carPortNum;

	@TableField(exist = false)
	private List<String> carIds;

	public String getEnterTypeName() {
		return CarEntryTypeEnum.getDesc(this.enterType);
	}

	public String getPlateColorName() {
		return CarPlateColorEnum.getDesc(this.plateColor);
	}

	public String getReleaseTypeName() {
		return CarReleaseTypeEnum.getDesc(this.releaseType);
	}
}
